﻿// ===============================================================================
// XCI.NET 西安交通信息WinForm开发框架 2018 版权所有
// ===============================================================================

using System;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTreeList;
using XCI.Helper;
using XCI.Windows;

namespace XCI.Setting.Controls
{
    public partial class SettingTreeOptionsView : BaseUserControl
    {
        private readonly TreeList treeList;
        public SettingTreeOptionsView(TreeList treeList)
        {
            InitializeComponent();
            this.treeList = treeList;
            InitForm();
        }

        private void InitForm()
        {
            if (WinFormHelper.IsDesignMode()) return;

            WinFormHelper.AddEnum(typeof(DefaultBoolean), editShowTreeLines);
            WinFormHelper.AddEnum(typeof(TreeListAnimationType), editAnimationType);
            WinFormHelper.AddEnum(typeof(WaitAnimationOptions), editWaitAnimationOptions);
            WinFormHelper.AddEnum(typeof(TreeListNewItemRowPosition), editNewItemRowPosition);
            WinFormHelper.AddEnum(typeof(ShowButtonModeEnum), editShowButtonMode);
            WinFormHelper.AddEnum(typeof(DrawFocusRectStyle),editFocusRectStyle);
            WinFormHelper.AddEnum(typeof(ScrollVisibility),boxHorzScrollVisibility, boxVertScrollVisibility);
            WinFormHelper.AddEnum(typeof(BorderStyles), editBorderStyles);
            WinFormHelper.AddEnum(typeof(LineStyle), editTreeLineStyle);

            WinFormHelper.AddEnum(typeof(DefaultNodeCheckBoxStyle), editCheckBoxStyle);
            WinFormHelper.AddEnum(typeof(NodeCheckBoxStyle), editRootCheckBoxStyle);
            WinFormHelper.AddEnum(typeof(RowImagesShowMode), editRowImagesShowMode);
            WinFormHelper.AddEnum(typeof(TreeListViewStyle), editTreeListViewStyle);

            WinFormHelper.BindCustomPropertyControlValue(layoutControl1, treeList);
        }
    }
}
